class Solution {
public:
    vector<bool> prefixesDivBy5(vector<int>& nums) {
        vector<bool> ans;
        long long  c = 0;
        for (auto& x : nums) {
            c = ((c << 1) + x) % 5;
            ans.emplace_back(c == 0);
        }
        return ans;
    }
};